<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    let source = `<template>
    <div>
        <div>111</div>
    </div>
    <div>
        <div>22</div>
    </div>
</template>
<style scss>
   a{background: red;}
</style>
`;

    let style = /(?:<style\s+(scss|sass|less|pcss)?>\s*(.*)\s*<\/style>)/igm;


    console.log(style.exec(source))


</script>
</body>
</html>
